CuttingEdge.Conditions reference library |
ValidatorExtensions..::.IsOfType<(Of <(T>)>) Method (ConditionValidator<(Of <(T>)>), Type) |
ValidatorExtensions Class See Also Send Feedback |
Checks whether the Type of the given value is of type.
An exception is thrown otherwise.
When the given value is a null reference, the check will always pass, regardless of the specified
type. Please use the IsNotNull method to check for null references).
Namespace:
CuttingEdge.Conditions
Assembly:
CuttingEdge.Conditions (in CuttingEdge.Conditions.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Shared Function IsOfType(Of T As Class) ( _ validator As ConditionValidator(Of T), _ type As Type _ ) As ConditionValidator(Of T) |
C# |
---|
public static ConditionValidator<T> IsOfType<T>( ConditionValidator<T> validator, Type type ) where T : class |
Visual C++ |
---|
public: generic<typename T> where T : ref class static ConditionValidator<T>^ IsOfType( ConditionValidator<T>^ validator, Type^ type ) |
JavaScript |
---|
JavaScript does not support generic types or methods. |
Parameters
- validator
- Type: CuttingEdge.Conditions..::.ConditionValidator<(Of <(T>)>)
The ConditionValidator<(Of <(T>)>) that holds the value that has to be checked.
- type
- Type: System..::.Type
The Type that will be used to perform the check.
Type Parameters
- T
- The type of the Value of the specified validator.
Return Value
The specified validator instance.Exceptions
Exception | Condition |
---|---|
System..::.ArgumentException | Thrown when the Value of the specified validator is not of the specified type, while the specified validator is created using the Requires extension method. |
CuttingEdge.Conditions..::.PostconditionException | Thrown when the Value of the specified validator is not of the specified type, while the specified validator is created using the Ensures extension method. |